package cn.wk.controller;

import cn.wk.client.UserClient;
import cn.wk.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.net.URI;
import java.util.List;

@RestController
@RequestMapping("/consumer/user")
public class ConsumerController {
    @Autowired
    private UserClient userClient;
    @RequestMapping("/{id}")
    private User getUser(@PathVariable("id") Long id){
        System.out.println(userClient.getUser(id));
        System.out.println(userClient.getClass());
        return userClient.getUser(id);
    }
}
